package test1;

/**
 * @author: hett
 * @date: 2022/1/12 11:34
 */
public class Bank {

    private int account;

    private double deposit;

    public Bank(int account, double deposit) {
        this.account = account;
        this.deposit = deposit;
    }

    public int getAccount() {
        return account;
    }

    public void setAccount(int account) {
        this.account = account;
    }

    public double getDeposit() {
        return deposit;
    }

    public void setDeposit(double deposit) {
        this.deposit = deposit;
    }

    public void move(Bank bank1, Bank bank2,double num){
        bank1.setDeposit(bank1.getDeposit()+num);
        bank2.setDeposit(bank2.getDeposit()-num);
        System.out.println("账号"+bank1.getAccount()+" to "+"账号"+bank2.getAccount()+"移动成功");
    }
}
